import http from '@/utils/http/axios';

// 添加角色
export function addRoleApi(params = {}) {
  return http.request({
    url: '/system/sysRole',
    method: 'post',
    params,
  });
}

// 修改角色
export function modifyRoleApi(params = {}) {
  return http.request({
    url: '/system/sysRole',
    method: 'put',
    params,
  });
}

// 查询角色
export function getRoleByParamApi(params = {}) {
  return http.request({
    url: '/system/sysRole/get',
    method: 'get',
    params,
  });
}

// 查询角色
export function getRoleListApi(params = {}) {
  return http.request({
    url: '/system/sysRole/page',
    method: 'get',
    params,
  });
}

// 删除角色
export function deleteRoleApi(params) {
  return http.request({
    url: `/system/sysRole/${params.id}`,
    method: 'delete',
  });
}

// 批量删除
export function deleteRolesApi(params) {
  return http.request({
    url: `/system/sysRole/delete`,
    method: 'delete',
    data: params,
  });
}

// 导出角色
export function exportRoleApi(params) {
  return http.request({
    url: `/system/sysRole/export`,
    method: 'post',
    data: params,
    responseType: 'blob',
  });
}
